public class HasQuarterState implements State
{
        Gumballmachine machine;

        public HasQuarterState(Gumballmachine in)
        {
                machine = in;
        }

        public void insertQuarter()
        {
                System.out.println("Already Have Quarter.");
        }

        public void ejectQuarter()
        {
                System.out.println("Quarter Ejecting.");
                machine.setState(machine.getNoQuarterState());
        }

        public void turnCrank()
        {
                System.out.println("Turning Crank.");
                machine.setState(machine.getSoldState());
        }

        public void dispense()
        {
                System.out.println("You can't get GumBall.");
        }
}
